package com.hbmcc.heshenghuo.functions.glide

import android.content.Context

/**
 * Copyright (c) 2020
 * author: whs
 * created on: 2020/9/17 16:06
 * description:Glide封装类
 */
object Img {

    @JvmStatic
    fun with(context: Context?): LoadInterface {
        return Load(context)
    }

    private class Load(context: Context?) : LoadInterface {
        val mContext: Context? = context

        /**
         * 加载String地址
         */
        override fun load(url: String?): ImgOptions {
            return ImgOptions(mContext, url, null, null)
        }

        /**
         * 加载资源文件
         */
        override fun load(res: Int?): ImgOptionsInterface {
            return ImgOptions(mContext, null, res, null)
        }

        override fun load(any: Any?): ImgOptionsInterface {
            return ImgOptions(mContext, null, null, any)
        }

    }
}